package com.atcumt.Huawei;

import java.util.Scanner;

/**
 * 字符串最后一个单词长度
 *
 * 输入：hello nowcoder
 * 输出：8
 *
 * 倒序打印
 */
public class HJ1 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        int count = 0;

        for (int i = s.length() - 1; i >= 0; i--) {
            if (s.charAt(i) == ' ') {
                break;
            }
            count++;
        }
        System.out.println(count);
    }
}
